<?php
include("../inc/Function.php");
if($_SESSION['a']['alevel']!=5 && $power['tjsp']!=1){
	echo "<script>alert('权限不足');window.location.href='index.php';</script>";exit;
}
$id = isset($_GET['gid'])?intval($_GET['gid']):0;

$page = isset($_GET['page'])?$_GET['page']:1;
$cplx = isset($_GET['cplx'])?$_GET['cplx']:0;
$cid = isset($_GET['cid'])?$_GET['cid']:0;
$tag1 = isset($_GET['tag1'])?$_GET['tag1']:0;
$tag2 = isset($_GET['tag2'])?$_GET['tag2']:0;
$type1 = isset($_GET['type1'])?$_GET['type1']:0;
$type2 = isset($_GET['type2'])?$_GET['type2']:0;
$type3 = isset($_GET['type3'])?$_GET['type3']:0;

$ginfo = getginfo($id);
if(!$ginfo || !$id){ echo "<script>window.location.href='goodslist.php?cplx=$cplx&cid=$cid&tag1=$tag1&tag2=$tag2&type1=$type1&type2=$type2&type3=$type3';</script>";exit;}
$menu = catelist($ginfo['cplx']);
$ginfo['content'] = htmlspecialchars_decode($ginfo['gcontent']);
$pic = $ginfo['gthumb1'];
$taglist1 = taglist(1,1);
$taglist2 = taglist(2,1);
$tpl->assign("pic",$pic);
$tpl->assign("cat",$menu);
$tpl->assign("ginfo",$ginfo);
$tpl->assign("taglist1",$taglist1);
$tpl->assign("taglist2",$taglist2);
$tpl->assign('cplx',$cplx);
$tpl->assign('cid',$cid);
$tpl->assign('tag1',$tag1);
$tpl->assign('tag2',$tag2);
$tpl->assign('type1',$type1);
$tpl->assign('type2',$type2);
$tpl->assign('type3',$type3);
$tpl->show('goodsedit');
?>